From 24ae14c5e5026fa8ffb92513f0ddcc43171df203 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Sun, 6 Oct 2013 21:12:04 +0000 Subject: [PATCH] Warning cleanpus from Conrad. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4631 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/defs.h | 4 +++- gpsbabel/gpx.cc | 22 ++++++++++++---------- gpsbabel/magproto.cc | 33 +++++++++++++++++++-------------- gpsbabel/mapsource.cc | 35 +++++++++++++++++++++++++++-------- 4 files changed, 61 insertions(+), 33 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 98cabc210..5694da8b0 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -828,7 +828,7 @@ void setshort_is_utf8(short_handle h, const int is_utf8); #define ARGTYPE_FLAGMASK 0xfffff000 #define ARG_NOMINMAX NULL, NULL -#define ARG_TERMINATOR {0, 0, 0, 0, 0, ARG_NOMINMAX} +#define ARG_TERMINATOR {0, 0, 0, 0, 0, ARG_NOMINMAX, NULL} typedef struct arglist { const char* argstring; @@ -878,6 +878,8 @@ typedef struct position_ops { ff_deinit wr_deinit; } position_ops_t; +#define NULL_POS_OPS { 0, 0, 0, 0, 0, 0, } + /* * Describe the file format to the caller. */ diff --git a/gpsbabel/gpx.cc b/gpsbabel/gpx.cc index b451f1786..c4ee42d5e 100644 --- a/gpsbabel/gpx.cc +++ b/gpsbabel/gpx.cc @@ -1670,7 +1670,7 @@ gpx_track_disp(const waypoint* waypointp) } static void -gpx_track_tlr(const route_head* rte) +gpx_track_tlr(const route_head*) { if (!QUEUE_EMPTY(¤t_trk_head->waypoint_list)) { writer->writeEndElement(); @@ -1737,7 +1737,7 @@ gpx_route_disp(const waypoint* waypointp) } static void -gpx_route_tlr(const route_head* rte) +gpx_route_tlr(const route_head*) { writer->writeEndElement(); // Close rte tag. } @@ -1895,35 +1895,35 @@ static arglist_t gpx_args[] = { { "snlen", &snlen, "Length of generated shortnames", - "32", ARGTYPE_INT, "1", NULL + "32", ARGTYPE_INT, "1", NULL, NULL }, { "suppresswhite", &suppresswhite, "No whitespace in generated shortnames", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "logpoint", &opt_logpoint, "Create waypoints from geocache log entries", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "urlbase", &urlbase, "Base URL for link tag in output", - NULL, ARGTYPE_STRING, ARG_NOMINMAX + NULL, ARGTYPE_STRING, ARG_NOMINMAX, NULL }, { "gpxver", &gpx_wversion, "Target GPX version for output", - NULL, ARGTYPE_STRING, ARG_NOMINMAX + NULL, ARGTYPE_STRING, ARG_NOMINMAX, NULL }, { "humminbirdextensions", &opt_humminbirdext, "Add info (depth) as Humminbird extension", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "garminextensions", &opt_garminext, "Add info (depth) as Garmin extension", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, ARG_TERMINATOR }; @@ -1939,5 +1939,7 @@ ff_vecs_t gpx_vecs = { gpx_write, gpx_exit, gpx_args, - CET_CHARSET_UTF8, 0 /* non-fixed to create non UTF-8 XML's for testing | CET-REVIEW */ + CET_CHARSET_UTF8, 0, /* non-fixed to create non UTF-8 XML's for testing | CET-REVIEW */ + NULL_POS_OPS, + NULL, }; diff --git a/gpsbabel/magproto.cc b/gpsbabel/magproto.cc index 0ab1d0b63..341501189 100644 --- a/gpsbabel/magproto.cc +++ b/gpsbabel/magproto.cc @@ -679,23 +679,23 @@ static arglist_t mag_sargs[] = { { "deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING, - ARG_NOMINMAX + ARG_NOMINMAX, NULL }, { "maxcmts", &cmts, "Max number of comments to write (maxcmts=200)", - "200", ARGTYPE_INT, ARG_NOMINMAX + "200", ARGTYPE_INT, ARG_NOMINMAX, NULL }, { "baud", &bs, "Numeric value of bitrate (baud=4800)", "4800", - ARGTYPE_INT, ARG_NOMINMAX + ARGTYPE_INT, ARG_NOMINMAX, NULL }, { "noack", &noack, "Suppress use of handshaking in name of speed", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "nukewpt", &nukewpt, "Delete all waypoints", NULL, ARGTYPE_BOOL, - ARG_NOMINMAX + ARG_NOMINMAX, NULL }, ARG_TERMINATOR }; @@ -704,11 +704,11 @@ static arglist_t mag_fargs[] = { { "deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING, - ARG_NOMINMAX + ARG_NOMINMAX, NULL }, { "maxcmts", &cmts, "Max number of comments to write (maxcmts=200)", - NULL, ARGTYPE_INT, ARG_NOMINMAX + NULL, ARGTYPE_INT, ARG_NOMINMAX, NULL }, ARG_TERMINATOR }; @@ -987,6 +987,7 @@ mag_trkparse(char* trkmsg) lngdir = ifield[4][0]; alt = atof(ifield[5]); altunits = ifield[6][0]; + (void)altunits; sscanf(ifield[7], "%d.%d", &hms, &fracsecs); /* Field 8 is constant */ /* Field nine is optional track name */ @@ -1030,7 +1031,6 @@ mag_trkparse(char* trkmsg) void mag_rteparse(char* rtemsg) { - char descr[100]; int n; int frags,frag,rtenum; char xbuf[100],next_stop[100],abuf[100]; @@ -1040,7 +1040,6 @@ mag_rteparse(char* rtemsg) char* p; char* rte_name = NULL; - descr[0] = 0; #if 0 sscanf(rtemsg,"$PMGNRTE,%d,%d,%c,%d%n", &frags,&frag,xbuf,&rtenum,&n); @@ -1431,7 +1430,7 @@ mag_waypt_pr(const waypoint* waypointp) } static -void mag_track_nop(const route_head* rte) +void mag_track_nop(const route_head*) { return; } @@ -1577,7 +1576,7 @@ mag_route_trl(const route_head* rte) } static void -mag_route_hdr(const route_head* rh) +mag_route_hdr(const route_head*) { } @@ -1656,7 +1655,9 @@ ff_vecs_t mag_svecs = { mag_write, NULL, mag_sargs, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ + CET_CHARSET_ASCII, 0, /* CET-REVIEW */ + NULL_POS_OPS, + NULL, }; ff_vecs_t mag_fvecs = { @@ -1670,7 +1671,9 @@ ff_vecs_t mag_fvecs = { mag_write, NULL, mag_fargs, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ + CET_CHARSET_ASCII, 0, /* CET-REVIEW */ + NULL_POS_OPS, + NULL, }; /* @@ -1687,5 +1690,7 @@ ff_vecs_t magX_fvecs = { mag_write, NULL, mag_fargs, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ + CET_CHARSET_ASCII, 0, /* CET-REVIEW */ + NULL_POS_OPS, + NULL, }; diff --git a/gpsbabel/mapsource.cc b/gpsbabel/mapsource.cc index 607024295..5c11dfdda 100644 --- a/gpsbabel/mapsource.cc +++ b/gpsbabel/mapsource.cc @@ -77,35 +77,38 @@ static char* mpsuseprox = NULL; static arglist_t mps_args[] = { - {"snlen", &snlen, "Length of generated shortnames", "10", ARGTYPE_INT, "1", NULL }, + { + "snlen", &snlen, "Length of generated shortnames", "10", ARGTYPE_INT, "1", + NULL, NULL + }, { "snwhite", &snwhiteopt, "Allow whitespace synth. shortnames", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "mpsverout", &mpsverout, "Version of mapsource file to generate (3,4,5)", NULL, - ARGTYPE_INT, ARG_NOMINMAX + ARGTYPE_INT, ARG_NOMINMAX, NULL }, { "mpsmergeout", &mpsmergeouts, "Merge output with existing file", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "mpsusedepth", &mpsusedepth, "Use depth values on output (default is ignore)", NULL, - ARGTYPE_BOOL, ARG_NOMINMAX + ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, { "mpsuseprox", &mpsuseprox, "Use proximity values on output (default is ignore)", - NULL, ARGTYPE_BOOL, ARG_NOMINMAX + NULL, ARGTYPE_BOOL, ARG_NOMINMAX, NULL }, ARG_TERMINATOR }; static void -mps_noop(const route_head* wp) +mps_noop(const route_head*) { /* no-op */ } @@ -429,6 +432,8 @@ mps_mapsegment_r(gbfile* mps_file, int mps_ver) { int reclen; + (void)mps_ver; + #if 0 /* At the moment we're not doing anything with map segments, but here's the template code as if we were */ char hdr[100]; @@ -464,6 +469,8 @@ mps_mapsetname_r(gbfile* mps_file, int mps_ver) { int reclen; + (void)mps_ver; + /* At the moment we're not doing anything with mapsetnames, but here's the template code as if we were char hdr[100]; mps_readstr(mps_file, hdr, sizeof(hdr)); @@ -490,6 +497,8 @@ mps_mapsetname_w(gbfile* mps_file, int mps_ver) char hdr[100]; int reclen; + (void)mps_ver; + hdr[0] = 'V'; /* mapsetname start of record indicator */ hdr[1] = 0; /* zero length null terminated string */ hdr[2] = 1; /* mapsetname autoname flag set to DO autoname */ @@ -944,6 +953,7 @@ mps_route_r(gbfile* mps_file, int mps_ver, route_head** rte) #endif mpsclass = gbfgetint32(mps_file); /* class */ + (void)mpsclass; mps_readstr(mps_file, tbuf, sizeof(tbuf)); /* country */ if ((mps_ver == 4) || (mps_ver == 5)) { @@ -1456,6 +1466,7 @@ mps_routetrlr_w(gbfile* mps_file, int mps_ver, const route_head* rte) char hdr[2]; int value = 0; + (void)mps_ver; hdr[0] = 1; if (rte->waypoint_list.next) { /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */ @@ -1490,6 +1501,8 @@ mps_track_r(gbfile* mps_file, int mps_ver, route_head** trk) double mps_altitude = unknown_alt; double mps_depth = unknown_alt; + (void)mps_ver; + trkname = gbfgetcstr(mps_file); #ifdef MPS_DEBUG fprintf(stderr, "mps_track_r: reading track %s\n", trkname); @@ -1575,6 +1588,8 @@ mps_trackhdr_w(gbfile* mps_file, int mps_ver, const route_head* trk) queue* elem, *tmp; + (void)mps_ver; + /* total nodes (waypoints) this track */ trk_datapoints = 0; if (trk->waypoint_list.next) { /* this test doesn't do what I want i.e test if this is a valid track - treat as a placeholder for now */ @@ -1642,6 +1657,8 @@ mps_trackdatapoint_w(gbfile* mps_file, int mps_ver, const waypoint* wpt) double mps_altitude = wpt->altitude; double mps_depth = unknown_alt; + (void)mps_ver; + lat = GPS_Math_Deg_To_Semi(wpt->latitude); lon = GPS_Math_Deg_To_Semi(wpt->longitude); if (WAYPT_HAS(wpt, depth) && mpsusedepth) { @@ -2093,5 +2110,7 @@ ff_vecs_t mps_vecs = { mps_write, NULL, mps_args, - CET_CHARSET_MS_ANSI /* CET-REVIEW */ + CET_CHARSET_MS_ANSI, 0, /* CET-REVIEW */ + NULL_POS_OPS, + NULL, }; -- 2.30.2